package ${c.modulePackage}.form;

<#list c.properties as p>
<#assign dateCount = 0>
<#if p.type == "Date" && dateCount == 0>
import java.util.Date;
<#assign dateCount = dateCount + 1>
</#if>
</#list>
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMapping;
import com.guinea.core.web.BaseForm;

public class ${c.name}Form extends BaseForm {
    <#list c.oneToOne as o>
    <#if o.inverse == "false">
    
    private Long ${o.className?uncap_first}Id;
    </#if>
    </#list>
    <#list c.manyToOne as mo>
    
    private Long ${mo.className?uncap_first}Id;
    </#list>
    <#list c.properties as p>
    
    private ${p.type} ${p.name};
    </#list>
    
    public void reset(ActionMapping mapping, HttpServletRequest request){
		super.reset(mapping,request);
		commonReset();
	}
	
	public void commonReset(){
	    <#list c.properties as p>
	    <#if p.element?? && p.element.defaultValue??>
	    <#if p.type == "String">
	    <#if p.element.defaultValue?contains(";")>
		${p.name} = ${p.element.defaultValue}
	    <#else>
		${p.name} = "${p.element.defaultValue}";
	    </#if>
	    <#else>
	    ${p.name} = ${p.element.defaultValue};
	    </#if>
	    </#if>
	    </#list>
	}

    <#list c.properties as p>

	public ${p.type} get${p.name?cap_first}() {
		return ${p.name};
	}

	public void set${p.name?cap_first}(${p.type} ${p.name}) {
		this.${p.name} = ${p.name};
	}
    </#list>
    <#list c.oneToOne as o>
    <#if o.inverse == "false">
    
	public Long get${o.refId?cap_first}() {
		return ${o.refId};
	}

	public void set${o.refId?cap_first}(Long ${o.refId}) {
		this.${o.refId} = ${o.refId};
	}
    </#if>
    </#list>
    <#list c.manyToOne as mo>
    
	public Long get${mo.refId?cap_first}() {
		return ${mo.refId};
	}

	public void set${mo.refId?cap_first}(Long ${mo.refId}) {
		this.${mo.refId} = ${mo.refId};
	}
    </#list>

}
